import { useMemo } from "react"
import { Tooltip, Progress } from "antd"
import { CompressTask } from "@renderer/services/ipc/ipc.constant"


type IProps = {
  task: CompressTask
}

export default function TaskStateIcon({task}: IProps) {
  const stateIconSet = {
    "0": <i className="iconfont icon-dengdai text-orange-400"></i>,
    "1": <Progress size={20} percent={task.progress.upload} type="circle" strokeColor="#fff"/>,
    "2": <i className="iconfont icon-wendangyasuo text-blue-400"></i>,
    "3": <Progress size={20} percent={task.progress.download} type="circle" strokeColor="#fff"/>,
    "4": <i className="iconfont icon-checkmark_circle text-green-400"></i>,
    "5": <i className="iconfont icon-info text-red-400"></i>,
  }
  return stateIconSet[task.state]
}